Previous Book Contents Book Index Next

Inside Macintosh: Programming With the Text Encoding Conversion Manager /
Chapter 4 - Unicode Converter Reference / Unicode Converter Structures and Other Types
/


TextToUnicodeInfo

A Unicode converter object is a private object containing mapping and state information. Many of the Unicode Converter functions that perform conversions require a Unicode converter object containing information used for the conversion process. There are three types of Unicode converter objects, all serving the same purpose but used for different types of conversions. You use the TextToUnicodeInfo type, described here, for converting from non-Unicode text to Unicode text.

Because your application cannot directly create or modify the contents of the private Unicode converter object, the Unicode Converter provides functions to create and dispose of it. To create a Unicode converter object for converting from non-Unicode text to Unicode text, your application must first call either the function CreateTextToUnicodeInfo (page 125) or the function CreateTextToUnicodeInfoByEncoding (page 127) to provide the mapping information required for the conversion. You can then pass this object to the function ConvertFromTextToUnicode (page 129) or ConvertFromPStringToUnicode (page 163) to identify the information to be used in performing the actual conversion. After you have finished using the object, you should release the memory allocated for it by calling the function DisposeTextToUnicodeInfo (page 133). The TextToUnicodeInfo data type defines the Unicode converter object.

typedef struct OpaqueTextToUnicodeInfo *TextToUnicodeInfo;
Another function, the function TruncateForTextToUnicode (page 160), also requires a Unicode converter object as a parameter. This function does not modify the contents of the private structure to which the Unicode converter object refers, so it uses the constant Unicode converter object defined by the ConstTextToUnicodeInfo data type.

typedef const TextToUnicodeInfo ConstTextToUnicodeInfo;
SEE ALSO
The Unicode converter object of type UnicodeToTextInfo (page 120) that you use for converting from Unicode text to non-Unicode text.

The Unicode converter object of type UnicodeToTextRunInfo (page 121) that you use to convert from Unicode text to runs of text expressed in various encodings.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 NOV 1997